﻿using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;

namespace MyTinnyApi.model
{
    [Table("t_folders")]
	public class Folder : INotifyPropertyChanged
    {
		private int id;
		private string name;
		private int parentId;
		private int showOrder;

		public int Id
		{
			get
			{
				return id;
			}
			set
			{
				id = value;
				OnPropertyChanged(nameof(Id));
			}
		}

        public string Name
        {
            get
            {
                return name;
            }
            set
            {
                name = value;
                OnPropertyChanged(nameof(Name));
            }
        }

        public int ParentId
        {
            get
            {
                return parentId;
            }
            set
            {
                parentId = value;
                OnPropertyChanged(nameof(ParentId));
            }
        }

        public int ShowOrder
        {
            get
            {
                return showOrder;
            }
            set
            {
                showOrder = value;
                OnPropertyChanged(nameof(ShowOrder));
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged(string propertyName)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}

